﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using netDxf;
using netDxf.Blocks;
using netDxf.Collections;
using netDxf.Entities;
using netDxf.Header;
using netDxf.Objects;
using netDxf.Tables;
using netDxf.Units;
using Attribute = netDxf.Entities.Attribute;
using Image = netDxf.Entities.Image;
using Point = netDxf.Entities.Point;
using Trace = netDxf.Entities.Trace;
using System.Threading;

namespace TestDxfDocument
{
    class ISYC_303_F34b
    {
        public static void ISYC_303_F34b_H(Dictionary<string, Object> data) //整体B型桶式立铣刀
        {
            DxfDocument dxf = new DxfDocument();
            //图层
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
            Layer dimensioning = new Layer("dimensioning");    //尺寸层
            Layer refin = new Layer("refin") { Color = AciColor.Red };    //基准线/内轮廓
            Layer centre = new Layer("centre") { Color = AciColor.Yellow };    //中性线
            Layer textlayer = new Layer("textlayer") { Color = AciColor.Blue };    //文本层
            Layer hatching = new Layer("hatching") { Color = AciColor.Blue };    //填充层
            Layer additionalline = new Layer("additionalline") { Color = AciColor.Cyan };    //附加线
            Layer cutting = new Layer("cutting") { Color = AciColor.Red };    //切削层
            Layer nocutting = new Layer("nocutting");    //非切削层
            Layer skcontour = new Layer("skcontour") { Color = AciColor.Cyan };    //sk轮廓层
            Layer skdimensioning = new Layer("skdimensioning");    //sk尺寸线层
            Layer skrefin = new Layer("skrefin") { Color = AciColor.Red };    //sk基准线/内轮廓
            Layer sktext = new Layer("sktext") { Color = AciColor.Blue };  //sk文本
            Layer skhatching = new Layer("skhatching") { Color = AciColor.Blue };    //sk填充
            Layer skadditionlline = new Layer("skadditionlline") { Color = AciColor.Cyan };    //sk附加线
            Layer skviewcontour = new Layer("skviewcontour") { Color = AciColor.Cyan };    //skview轮廓
            Layer skviewdimensioning = new Layer("skviewdimensioning");    //skview尺寸线层

            //基本参数-------------------------------------------------------------------------------------------------
            double pi = Math.PI;
            string path = Convert.ToString(data["path"]);

            //赋值参数--------------------------------------------------------------------------------------------------
            double OAL = 60.01;
            double LPR = 29.94;
            double APMX = 15.73;
            double DCONMS = 9.01;
            double DC = 16.97;
            double LH = 23.16;
            double scale = 60.01 / OAL;

            //点---------------------------------------------------------------------------------------------
            //第一部分
            //轮廓
            Vector2 v1 = new Vector2(0, 0);
            Vector2 v2 = new Vector2(v1.X + OAL, 0);
            Vector2 v3 = fun.Polar(v1, 90 * pi / 180, DCONMS * 0.5 * 0.8);
            Vector2 v4 = fun.Inters(v3, fun.Polar(v3, 45 * pi / 180, OAL), fun.Polar(v1, 90 * pi / 180, DCONMS / 2.0), new Vector2(v1.X + OAL, v1.Y + DCONMS / 2.0));
            Vector2 v5 = new Vector2(v1.X + OAL * 0.6, v4.Y);
            Vector2 v6 = fun.Polar(v5, 90 * pi / 180, (1.78 / 16.97) * DC);
            Vector2 v7 = fun.Polar(v6, 61 * pi / 180, (1.32 / 15.73) * APMX);
            Vector2 v8 = fun.Polar(v7, 1 * pi / 180, (20.45 / 29.94) * LPR);
            Vector2 v9 = fun.Polar(v8, -34 * pi / 180, (1.16 / 16.97) * DC);
            Vector2 v10= fun.Polar(v8, -45 * pi / 180, (1.92 / 16.97) * DC);
            Vector2 v11 = new Vector2(v10.X, -v10.Y);
            Vector2 v12 = new Vector2(v8.X, -v8.Y);
            Vector2 v13 = new Vector2(v7.X, -v7.Y);
            Vector2 v14 = new Vector2(v6.X, -v6.Y);
            Vector2 v15 = new Vector2(v5.X, -v5.Y);
            Vector2 v16 = new Vector2(v4.X, -v4.Y);
            Vector2 v17 = new Vector2(v3.X, -v3.Y);
            Vector2 v18 = new Vector2(v1.X + (OAL - LPR), v1.Y);
            Vector2 v19 = fun.Polar(v18, 0 * pi / 180, (4.7 / 29.94) * LPR);
            Vector2 v20 = fun.Polar(v2, 0 * pi / 180, (6.32 / 29.94) * LPR);
            Vector2 v21 = fun.Polar(v7, 4 * pi / 180, (16.84 / 15.73) * APMX);
            Vector2 v22 = fun.Polar(v21, -168 * pi / 180, (15.24 / 15.73) * APMX);
            Vector2 v23 = fun.Polar(v22, -83 * pi / 180, (4.24 / 16.97) * DC);
            Vector2 v24 = fun.Polar(v23, 27 * pi / 180, (10.09 / 15.73) * APMX);
            Vector2 v25 = fun.Polar(v24, -90 * pi / 180, (3.65 / 16.97) * DC);
            Vector2 v26 = fun.Polar(v24, -90 * pi / 180, (1.45 / 16.97) * DC);
            Vector2 v27 = fun.Polar(v24, -90 * pi / 180, (2.24 / 16.97) * DC);
            Vector2 v28 = fun.Polar(v27, -150 * pi / 180, (9.62 / 15.73) * APMX);
            Vector2 v29 = fun.Polar(v28, -82 * pi / 180, (4.34 / 16.97) * DC);
            Vector2 v30 = fun.Polar(v29, 28 * pi / 180, (18.99 / 16.97) * DC);
            Vector2 v31 = fun.Polar(v30, -59 * pi / 180, (0.83 / 16.97) * DC);
            Vector2 v32 = fun.Polar(v31, -90 * pi / 180, (0.99 / 16.97) * DC);
            Vector2 v33 = fun.Polar(v31, -90 * pi / 180, (2.08 / 16.97) * DC);
            Vector2 v34 = fun.Polar(v33, -127 * pi / 180, (1.81 / 16.97) * DC);
            Vector2 v35 = fun.Polar(v34, -50 * pi / 180, (1.35 / 16.97) * DC);
            Vector2 v36 = fun.Polar(v29, 26 * pi / 180, (7.98 / 15.73) * APMX);
            Vector2 v37 = fun.Polar(v36, -90 * pi / 180, (1.57 / 16.97) * DC);
            Vector2 v38 = fun.Polar(v36, -90 * pi / 180, (0.73 / 16.97) * DC);
            Vector2 v39 = fun.Polar(v14, 0 * pi / 180, (5.96 / 15.73) * APMX);
            Vector2 v40 = fun.Polar(v39, 5 * pi / 180, (15.97 / 15.73) * APMX);
            Vector2 v41 = fun.Inters(v39, fun.Polar(v39, 10 * pi / 180, OAL), v40, v2);
            Vector2 v42 = fun.Polar(v12, -166 * pi / 180, (2.12 / 15.73) * APMX);
            Vector2 v43 = fun.Polar(v10, -167 * pi / 180, (0.7 / 16.97) * DC);
            Vector2 v44 = fun.Polar(v7, 12 * pi / 180, (6.86 / 15.73) * APMX);

            //第二部分
            //轮廓
            Vector2 v45 = fun.Polar(v16, -70 * pi / 180, (42.03 / 16.97) * DC);
            Vector2 v46 = new Vector2(v45.X + LH * 0.3, v45.Y);
            Vector2 v47 = fun.Polar(v46, 90 * pi / 180, (1.78 / 16.97) * DC);
            Vector2 v47_1 = fun.Polar(v47, 61 * pi / 180, (1.32 / 15.73) * APMX);
            Vector2 v48 = fun.Polar(v47_1, 1 * pi / 180, (20.45 / 29.94) * LPR);
            Vector2 v49 = fun.Polar(v48, -45 * pi / 180, (1.92 / 16.97) * DC);
            Vector2 v45_1 = fun.Polar(v45, -90 * pi / 180, DCONMS * 0.5);
            Vector2 v45_2 = fun.Polar(v45_1, 0 * pi / 180, OAL * 2);
            Vector2 v50 = fun.mirrorpoint(v49, v45_1, v45_2);
            Vector2 v51 = fun.mirrorpoint(v48, v45_1, v45_2);
            Vector2 v52 = fun.mirrorpoint(v47_1, v45_1, v45_2);
            Vector2 v53 = fun.mirrorpoint(v47, v45_1, v45_2);
            Vector2 v54 = fun.mirrorpoint(v46, v45_1, v45_2);
            Vector2 v55 = fun.mirrorpoint(v45, v45_1, v45_2);

            //虚线
            Vector2 v56 = fun.Polar(v45, 124 * pi / 180, (18.72 / 23.16) * LH);
            Vector2 v57 = fun.Polar(v56, -90 * pi / 180, (45.03 / 23.16) * LH);
            Vector2 v58 = fun.Polar(v57, 0 * pi / 180, (57.67 / 23.16) * LH);
            Vector2 v59 = fun.Polar(v58, 90 * pi / 180, (44.9 / 23.16) * LH);

            //标注
            Vector2 v60 = fun.Polar(v47_1, 9 * pi / 180, (3.47 / 23.16) * LH);
            Vector2 v61 = fun.Polar(v56, 160 * pi / 180, (32.12 / 16.97) * DC);

            //作图部分-----------------------------------------------------------------------
            //第一部分
            //中心线
            Line line1 = new Line(v1, v2);
            line1.Layer = centre;
            line1.Linetype = Linetype.Center;
            line1.LinetypeScale = 5;
            dxf.AddEntity(line1);

            //轮廓
            LwPolyline polyline1 = new LwPolyline();
            polyline1.Vertexes.Add(new LwPolylineVertex(v1));
            polyline1.Vertexes.Add(new LwPolylineVertex(v3));//0
            polyline1.Vertexes.Add(new LwPolylineVertex(v4));//1
            polyline1.Vertexes.Add(new LwPolylineVertex(v5));//2
            polyline1.Vertexes.Add(new LwPolylineVertex(v6));//3
            polyline1.Vertexes.Add(new LwPolylineVertex(v7));//4
            polyline1.Vertexes.Add(new LwPolylineVertex(v8));//5
            polyline1.Vertexes.Add(new LwPolylineVertex(v10));//6
            polyline1.Vertexes.Add(new LwPolylineVertex(v2));//7
            polyline1.Vertexes.Add(new LwPolylineVertex(v11));//8
            polyline1.Vertexes.Add(new LwPolylineVertex(v12));//9
            polyline1.Vertexes.Add(new LwPolylineVertex(v13));//10
            polyline1.Vertexes.Add(new LwPolylineVertex(v14));//11
            polyline1.Vertexes.Add(new LwPolylineVertex(v15));//12
            polyline1.Vertexes.Add(new LwPolylineVertex(v16));//13
            polyline1.Vertexes.Add(new LwPolylineVertex(v17));//14
            polyline1.Vertexes.Add(new LwPolylineVertex(v1));//15
            polyline1.Vertexes[4].Bulge = Math.Tan(-48 * pi / 180 / 4);
            polyline1.Vertexes[5].Bulge = Math.Tan(-33 * pi / 180 / 4);
            polyline1.Vertexes[6].Bulge = Math.Tan(-51 * pi / 180 / 4);
            polyline1.Vertexes[7].Bulge = Math.Tan(-18 * pi / 180 / 4);
            polyline1.Vertexes[8].Bulge = Math.Tan(-18 * pi / 180 / 4);
            polyline1.Vertexes[9].Bulge = Math.Tan(-51 * pi / 180 / 4);
            polyline1.Vertexes[10].Bulge = Math.Tan(-33 * pi / 180 / 4);
            polyline1.Vertexes[11].Bulge = Math.Tan(-48 * pi / 180 / 4);
            fun.PolyFill(dxf, polyline1, 0.3, contour);

            LwPolyline polyline2 = new LwPolyline();
            polyline2.Vertexes.Add(new LwPolylineVertex(v4));
            polyline2.Vertexes.Add(new LwPolylineVertex(v16));
            fun.PolyFill(dxf, polyline2, 0.3, contour);

            LwPolyline polyline3 = new LwPolyline();
            polyline3.Vertexes.Add(new LwPolylineVertex(v21));
            polyline3.Vertexes.Add(new LwPolylineVertex(v22));//0
            polyline3.Vertexes.Add(new LwPolylineVertex(v23));//1
            polyline3.Vertexes.Add(new LwPolylineVertex(v8));//2
            polyline3.Vertexes[0].Bulge = Math.Tan(14 * pi / 180 / 4);
            polyline3.Vertexes[1].Bulge = Math.Tan(140 * pi / 180 / 4);
            polyline3.Vertexes[2].Bulge = Math.Tan(-27 * pi / 180 / 4);
            fun.PolyFill(dxf, polyline3, 0.3, contour);

            LwPolyline polyline4 = new LwPolyline();
            polyline4.Vertexes.Add(new LwPolylineVertex(v24));
            polyline4.Vertexes.Add(new LwPolylineVertex(v25));//0
            polyline4.Vertexes.Add(new LwPolylineVertex(v10));//1
            polyline4.Vertexes[1].Bulge = Math.Tan(-21 * pi / 180 / 4);
            fun.PolyFill(dxf, polyline4, 0.3, contour);

            LwPolyline polyline5 = new LwPolyline();
            polyline5.Vertexes.Add(new LwPolylineVertex(v26));
            polyline5.Vertexes.Add(new LwPolylineVertex(v9));//0
            polyline5.Vertexes[0].Bulge = Math.Tan(-14 * pi / 180 / 4);
            fun.PolyFill(dxf, polyline5, 0.3, contour);

            LwPolyline polyline6 = new LwPolyline();
            polyline6.Vertexes.Add(new LwPolylineVertex(v27));
            polyline6.Vertexes.Add(new LwPolylineVertex(v28));//0
            polyline6.Vertexes.Add(new LwPolylineVertex(v29));//1
            polyline6.Vertexes.Add(new LwPolylineVertex(v30));//2
            polyline6.Vertexes[0].Bulge = Math.Tan(22 * pi / 180 / 4);
            polyline6.Vertexes[1].Bulge = Math.Tan(127 * pi / 180 / 4);
            polyline6.Vertexes[2].Bulge = Math.Tan(9 * pi / 180 / 4);
            fun.PolyFill(dxf, polyline6, 0.3, contour);

            LwPolyline polyline7 = new LwPolyline();
            polyline7.Vertexes.Add(new LwPolylineVertex(v14));
            polyline7.Vertexes.Add(new LwPolylineVertex(v39));//0
            polyline7.Vertexes.Add(new LwPolylineVertex(v40));//1
            polyline7.Vertexes.Add(new LwPolylineVertex(v2));//2
            polyline7.Vertexes[0].Bulge = Math.Tan(21 * pi / 180 / 4);
            polyline7.Vertexes[1].Bulge = Math.Tan(30 * pi / 180 / 4);
            fun.PolyFill(dxf, polyline7, 0.3, contour);

            LwPolyline polyline8 = new LwPolyline();
            polyline8.Vertexes.Add(new LwPolylineVertex(v39));
            polyline8.Vertexes.Add(new LwPolylineVertex(v32));//0
            polyline8.Vertexes[0].Bulge = Math.Tan(7 * pi / 180 / 4);
            fun.PolyFill(dxf, polyline8, 0.3, contour);

            LwPolyline polyline9 = new LwPolyline();
            polyline9.Vertexes.Add(new LwPolylineVertex(v9));
            polyline9.Vertexes.Add(new LwPolylineVertex(v43));//0
            polyline9.Vertexes.Add(new LwPolylineVertex(v30));//1
            polyline9.Vertexes.Add(new LwPolylineVertex(v31));//2
            polyline9.Vertexes.Add(new LwPolylineVertex(v33));//3
            polyline9.Vertexes.Add(new LwPolylineVertex(v34));//4
            polyline9.Vertexes.Add(new LwPolylineVertex(v35));//5
            polyline9.Vertexes.Add(new LwPolylineVertex(v12));//6
            fun.PolyFill(dxf, polyline9, 0.3, contour);

            LwPolyline polyline10 = new LwPolyline();
            polyline10.Vertexes.Add(new LwPolylineVertex(v39));
            polyline10.Vertexes.Add(new LwPolylineVertex(v41));//0
            polyline10.Vertexes[0].Bulge = Math.Tan(32 * pi / 180 / 4);
            fun.PolyFill(dxf, polyline10, 0.3, contour);

            LwPolyline polyline11 = new LwPolyline();
            polyline11.Vertexes.Add(new LwPolylineVertex(v38));
            polyline11.Vertexes.Add(new LwPolylineVertex(v31));
            fun.PolyFill(dxf, polyline11, 0.3, contour);

            LwPolyline polyline12 = new LwPolyline();
            polyline12.Vertexes.Add(new LwPolylineVertex(v36));
            polyline12.Vertexes.Add(new LwPolylineVertex(v37));
            fun.PolyFill(dxf, polyline12, 0.3, contour);

            //第二部分
            LwPolyline polyline13 = new LwPolyline();
            polyline13.Vertexes.Add(new LwPolylineVertex(v45));
            polyline13.Vertexes.Add(new LwPolylineVertex(v46));//0
            polyline13.Vertexes.Add(new LwPolylineVertex(v47));//1
            polyline13.Vertexes.Add(new LwPolylineVertex(v47_1));//2
            polyline13.Vertexes.Add(new LwPolylineVertex(v48));//3
            polyline13.Vertexes.Add(new LwPolylineVertex(v49));//4
            polyline13.Vertexes.Add(new LwPolylineVertex(v50));//5
            polyline13.Vertexes.Add(new LwPolylineVertex(v51));//6
            polyline13.Vertexes.Add(new LwPolylineVertex(v52));//7
            polyline13.Vertexes.Add(new LwPolylineVertex(v53));//8
            polyline13.Vertexes.Add(new LwPolylineVertex(v54));//9
            polyline13.Vertexes.Add(new LwPolylineVertex(v55));//10
            polyline13.Vertexes.Add(new LwPolylineVertex(v45));//11
            polyline13.Vertexes[2].Bulge = Math.Tan(-48 * pi / 180 / 4);
            polyline13.Vertexes[3].Bulge = Math.Tan(-33 * pi / 180 / 4);
            polyline13.Vertexes[4].Bulge = Math.Tan(-51 * pi / 180 / 4);
            polyline13.Vertexes[5].Bulge = Math.Tan(-18 * pi / 180 / 4);
            polyline13.Vertexes[6].Bulge = Math.Tan(-51 * pi / 180 / 4);
            polyline13.Vertexes[7].Bulge = Math.Tan(-33 * pi / 180 / 4);
            polyline13.Vertexes[8].Bulge = Math.Tan(-48 * pi / 180 / 4);
            fun.PolyFill(dxf, polyline13, 0.3, contour);

            //虚线
            LwPolyline polyline14 = new LwPolyline();
            polyline14.Vertexes.Add(new LwPolylineVertex(v56));
            polyline14.Vertexes.Add(new LwPolylineVertex(v57));
            polyline14.Vertexes.Add(new LwPolylineVertex(v58));
            polyline14.Vertexes.Add(new LwPolylineVertex(v59));
            polyline14.Linetype = Linetype.Dashed;
            polyline14.LinetypeScale = 5;
            polyline14.Layer = refin;
            dxf.AddEntity(polyline14);

            //填充
            LwPolyline hatchpoly1 = new LwPolyline();
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v45));
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v46));//0
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v47));//1
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v47_1));//2
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v48));//3
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v49));//4
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v50));//5
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v51));//6
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v52));//7
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v53));//8
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v54));//9
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v55));//10
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v45));//11
            hatchpoly1.Vertexes[2].Bulge = Math.Tan(-48 * pi / 180 / 4);
            hatchpoly1.Vertexes[3].Bulge = Math.Tan(-33 * pi / 180 / 4);
            hatchpoly1.Vertexes[4].Bulge = Math.Tan(-51 * pi / 180 / 4);
            hatchpoly1.Vertexes[5].Bulge = Math.Tan(-18 * pi / 180 / 4);
            hatchpoly1.Vertexes[6].Bulge = Math.Tan(-51 * pi / 180 / 4);
            hatchpoly1.Vertexes[7].Bulge = Math.Tan(-33 * pi / 180 / 4);
            hatchpoly1.Vertexes[8].Bulge = Math.Tan(-48 * pi / 180 / 4);
            hatchpoly1.IsClosed = true;
            String[] htype1 = new String[100];
            Line[] hline1 = new Line[100];
            Arc[] harc1 = new Arc[100];
            int hnumst1 = hatchpoly1.Explode().Count;  //记录爆炸后，线段有多少
            for (int i = 0; i < hnumst1; i++)
            {
                htype1[i] = hatchpoly1.Explode()[i].Type.ToString();    //将所有的元素记录成一个数组
                if (htype1[i] == "Line")
                {
                    hline1[i] = (Line)hatchpoly1.Explode()[i];
                }
                if (htype1[i] == "Arc")
                {
                    harc1[i] = (Arc)hatchpoly1.Explode()[i];
                }
            }
            fun.hatchsub1(dxf, htype1, hnumst1, 45, 10, hline1, harc1, hatching);
            
            //标注---------------------------------------------------------------------------
            double height = 2 * scale;
            double arrowsize = 1 * scale;
            double exline = 0.5 * scale;

            //坐标系
            /*fun.Axis(dxf, v1, 90, 180, "", "", "PCS", 0.3 * scale, height, 0);
            fun.Axis(dxf, v18, 90, 180, "", "", "MCS", 0.3 * scale, height, 0);
            fun.Axis(dxf, v2, 90, 180, "", "", "CIP", 0.3 * scale, height, 0);
            fun.Axis(dxf, v61, 90, 180, "Z", "Y", "X", 0.3 * scale, height, 0);*/

            //直线标注
            //DCONMS
            fun.dimrot1(dxf, v16, v4, 90, APMX * 0.5, 0.1, height, arrowsize, exline, "DCONMS", "", "");

            //OAL
            fun.dimrot1(dxf, v3, v2, 0, DC * 2, 0.1, height, arrowsize, exline, "OAL,LF", "", "");

            //LPR
            fun.dimrot1(dxf, v18, v2, 0, DC * 1.5, 0.1, height, arrowsize, exline, "LPR,LTA", "", "");

            //APMX
            fun.dimrot1(dxf, v44, v2, 0, DC * 0.8, 0.1, height, arrowsize, exline, "APMX", "", "");

            //DC
            fun.dimrot1(dxf, v21, v12, -90, APMX, 0.1, height, arrowsize, exline, "DC", "", "");

            //LH
            fun.dimrot1(dxf, v47, fun.Polar(v49, -83 * pi / 180, (6.11 / 16.97) * DC), 0, DC * 0.5, 0.1, height, arrowsize, exline, "LH", "", "");

            //箭头
            //CCMS
            fun.jt1(dxf, fun.Polar(v4, 0 * pi / 180, (OAL - LPR) / 2.0), 135, 1, 5, "CCMS", height);

            //A
            fun.jt1(dxf, v19, 90, 5, 1, "A", height);
            fun.jt1(dxf, v20, 90, 5, 1, "A", height);

            //FDP
            fun.jt1(dxf, fun.Polar(v10, 40 * pi / 180, (27.88 / 16.97) * DC), -90, 5, 1, "FDP", height);

            //RE_2
            fun.jt1(dxf, v47, 145, 5, 1, "RE_2", height);

            //RE
            fun.jt1(dxf, v49, 35, 5, 1, "RE", height);

            //PRFRAD
            fun.jt1(dxf, v60, -80, 20, 0.1, "PRFRAD", height);

            //定义格式，根据路径导出
            dxf.DrawingVariables.AcadVer = DxfVersion.AutoCad2007;
            dxf.Save(path);
        }
    }
}
